package 懒加载延时赋值

class Player5(_name: String) {
    var name = _name
    val config by lazy { loadConfig() }

    private fun loadConfig(): String {
        //println("$name loading.......")
        return "$name loading......."
    }
}

fun main() {
    val player5 = Player5("Jack")
    Thread.sleep(3000)
    println(player5.config)
}